package com.baosight.xdata;

import com.baosight.xdata.redis.LettuceUtil;
import io.lettuce.core.RedisURI;

import java.time.Duration;
import java.util.HashSet;
import java.util.Set;

public class App {
    public static void main(String[] args) {
        Set<RedisURI> uris = new HashSet<>();
        uris.add(RedisURI.builder().withHost("10.25.10.102").withPort(6378).withTimeout(Duration.ofSeconds(30)).build());
        uris.add(RedisURI.builder().withHost("10.25.10.102").withPort(6377).withTimeout(Duration.ofSeconds(30)).build());
        uris.add(RedisURI.builder().withHost("10.25.10.102").withPort(6379).withTimeout(Duration.ofSeconds(30)).build());
        uris.add(RedisURI.builder().withHost("10.25.10.104").withPort(6378).withTimeout(Duration.ofSeconds(30)).build());
        uris.add(RedisURI.builder().withHost("10.25.10.104").withPort(6377).withTimeout(Duration.ofSeconds(30)).build());
        uris.add(RedisURI.builder().withHost("10.25.10.104").withPort(6379).withTimeout(Duration.ofSeconds(30)).build());
        LettuceUtil.init(uris);



        StreamProducer streamProducer = new StreamProducer();
        Thread thread = new Thread(streamProducer);
        thread.start();


        //for(int i=0;i<10;i++){
        //    StreamConsumer streamConsumer = new StreamConsumer();
        //    Thread consumerThread = new Thread(streamConsumer);
         //   consumerThread.start();
        //}
    }
}
